// edit file finally enabled
public class Selection {

	private int[] tab;
	private int size;
		
	public Selection(){
		int i;
		for(i = 1; i < size; ++i ){
			tab[i] = 0;
		}
	 }
	
	/*
	 * Getter and setter
	 */
	public int getSize() {
		return size;
	}
	public void setSize(int size) {
		this.size = size;
	}
	public int[] getTab() {
		return tab;
	}
	public void setTab(int[] tab) {
		this.tab = tab;
	}
	/*
	 * Display tab
	 */
	public void displayTab(Selection t){
		int i;
		System.out.print("\n");
		for(i = 0; i < size; ++i ){
			System.out.print(t.tab[i]+",");
		}
	}
	/*
	 * Echange
	 */
	public void echange(Selection t, int a, int b){
		int x;
		x = t.tab[a];	t.tab[a] = t.tab[b];	t.tab[b] = x;
	}
	/*
	 * Sort method
	 */
	public void sort(Selection t){
		int i,j, min;
		min = t.tab[0];
		for(i = 0; i < size-1; ++i ){
			min = i;
			for(j = i+1; j < size; j++ ){
				if(t.tab[j]<t.tab[min])
					min = j;
			}
			if(min != i)echange(t, min, i);
		}
	}
	
	/*
	 * Main
	 */
	public static void main(String[] args) {
		Selection tab = new Selection();
		tab.setSize(10);
		int[] t = {10,2,13,15,9,8,-1,11,-5,7};
		tab.setTab(t);
		tab.displayTab(tab);
		tab.sort(tab);
		tab.displayTab(tab);
	}

}